package com.diligreat.action; 

import java.util.List;

import com.diligreat.action.base.BaseAction;
import com.diligreat.domain.Langmodel;
import com.diligreat.service.LangmodelService;
import com.opensymphony.xwork2.ModelDriven;

/**  
 * @Author Bruce 
 * @Date 2012-11-11
 * @Comments
 */
public class LangmodelAction extends BaseAction implements ModelDriven<Langmodel>{
	private static final long serialVersionUID = 1L;
	
	private Langmodel langmodel = new Langmodel();
	private List<Langmodel> listLangmodel = null;
	private LangmodelService langmodelService;
	
	public String input(){
		
		return INPUT;
	}
	
	public String add(){
		langmodelService.add(langmodel);
		return "operateSucc";
	}
	
	public String edit(){
		langmodel = langmodelService.get(langmodel.getId());
		return SUCCESS;
	}
	
	public String editSubmiit(){
		langmodelService.update(langmodel);
		return "operateSucc";
	}
	
	public String del(){
		langmodelService.delete(langmodel.getId());
		return "goList";
	}
	
	public String list(){
		listLangmodel = langmodelService.listAll();
		return SUCCESS;
	}

	public void setLangmodelService(LangmodelService langmodelService) {
		this.langmodelService = langmodelService;
	}

	@Override
	public Langmodel getModel() {
		return langmodel;
	}

	public List<Langmodel> getListLangmodel() {
		return listLangmodel;
	}

	/*public Langmodel getLangmodel() {
		return langmodel;
	}*/

	
}
 